package com.lyz.sku;

import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.core.env.Environment;

/**
 * @Author: LiYize
 * @Description: 商品微服务启动类
 * @DateTime: 2023/12/5 14:20
 **/
@SpringBootApplication
@MapperScan(value = "com.lyz.*.dao")
@ComponentScan(value = "com.lyz")
@EnableCaching
@Slf4j
public class SkuApplication {

    public static void main(String[] args) {
        System.setProperty("Log4jContextSelector", "org.apache.logging.log4j.core.async.AsyncLoggerContextSelector");
        ConfigurableApplicationContext run = SpringApplication.run(SkuApplication.class);
        Environment environment = run.getEnvironment();
        String port = environment.getProperty("server.port");
        log.info("项目启动成功！\n\t" +
                "----------------------------------------------------------\n\t" +
                "Swagger: http://localhost:" + port + "/swagger-ui.html\n\t" +
                "----------------------------------------------------------");
    }

}
